<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			// 添加错误处理
			this.handleError()
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		},
		onError: function(error) {
			console.error('App Error:', error)
		},
		methods: {
			handleError() {
				// 捕获全局错误
				uni.onError((error) => {
					console.error('Global Error:', error)
					// 过滤掉已知的微信开发者工具错误
					if (error && error.includes && !error.includes('webapi_getwxaasyncsecinfo:fail')) {
						console.error('Unhandled Error:', error)
					}
				})
			}
		}
	}
</script>

<style>
	/*每个页面公共css */
	
	/* 全局返回按钮样式 */
	.global-back-button {
		width: 60rpx;
		height: 60rpx;
		background: #FF0000;
		border-radius: 50%;
		display: flex;
		align-items: center;
		justify-content: center;
		margin-right: 15rpx;
	}
	
	.global-back-icon {
		color: white;
		font-size: 40rpx;
		font-weight: bold;
	}
	
	.global-back-text {
		color: white;
		font-size: 28rpx;
		font-weight: bold;
	}
	
	.global-header-left {
		display: flex;
		align-items: center;
	}
</style>
